<?php

/**
 * Controller class with automatic retrieval of DB instance
 * @author Joe Minichino <joe@dsforge.net>
 * 
 */
class Controller {

    /* @var $db DB */
    protected $db;
    protected $params;

    public function  __construct() {
        Debug::log("Creating " . __CLASS__);
        $this->db = DB::get();
        if($_POST){ $this->params = $_POST; }
        else $this->params = $_GET;
    }

    public function getView($file){
        return new View($file);
    }

}